package com.itheima.springbootmybatisdemo.controller;


import com.itheima.springbootmybatisdemo.pojo.Emp;
import com.itheima.springbootmybatisdemo.pojo.Result;
import com.itheima.springbootmybatisdemo.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Author mr.luo
 * @Date 15 4月 2025 17:09
 */
@RestController
public class EmpController {
    @Autowired
    private EmpService empService;

    /**
     * 添加员工
     */
    @PostMapping("/addEmp")
    public Result addEmp(@RequestBody Emp emp) {
        empService.addEmp(emp);
        return Result.success();
    }
}
